function redraw()
	local filename = "../webservice/gruposAD_jogos"
    file, err = io.open(filename, "r")
    if (err == nil) then
        canvas:attrFont('vera',20,'bold')
        local i = 0
        local mudaGrupo = 1
        local mudaLinha = 0
        for line in file:lines() do
            --print ("****" .. line)
            value1, value2 = string.match(line, "^([0-9]*)[ ]*([0-9]*)$")
            grupo = string.match(line, "^([a-zA-Z ]*)$")            
            if (value1 ~= nil) then
            	if (mudaLinha < 3) then
                	canvas:drawText(268 + (mudaGrupo * 250), 34 + (i * 22), value1)
                	canvas:drawText(318 + (mudaGrupo * 250), 34 + (i * 22), value2)
                elseif (mudaLinha < 5) then
                	canvas:drawText(268 + (mudaGrupo * 250), 34 + (i * 22) + 200, value1)
                	canvas:drawText(318 + (mudaGrupo * 250), 34 + (i * 22) + 200, value2)
                end
            elseif (grupo ~= nil) then
                mudaLinha = mudaLinha + 1
                i = 0
                if (mudaGrupo == 0) then
                    mudaGrupo = 1
                else
                    mudaGrupo = 0
                end
            end
            i = i + 1
            canvas:flush()
        end
        file:close()
    else 
        print (err)
    end
end

redraw()